A virtual machine monitor (hereinafter, it is referred to as “VMM”) operates on a platform hardware, and on which one or more virtual machines (hereinafter, it is referred to as “VM”) can be executed. The virtual machine is a logical platform created by software, and can execute a guest operating system and a guest application (hereinafter, these are referred to as “guest” or “guest VM”).
In a virtual machine technology, there are two virtualization methods, one is “emulation” and another is “direct execution”. In the emulation, a guest's instruction is executed while performing a sequential conversion of it or the guest's instruction is converted into a binary code in advance and it is executed. In the direct execution, the guest's instruction is directly executed on a processor. In the direct execution, the guest's instruction may be executed in a privileged mode that is lower than the VMM, and with respect to a sensitive instruction for sensing or changing a state of a system resource, or an operation mode, the VMM traps the instruction and emulates the state changes. Generally, an execution speed of the direct execution is higher than that of the emulation.
By the way, an overhead of an instruction to execute a trap and change a mode is larger than that of a usual instruction. For example, in case of Pentium (registered trademark) 4 processor which supports Intel Virtualization Technology advocated by Intel Corporation, a VM-Entry instruction to transfer a control to the VM from the VMM and a VM-Exit instruction to transfer a control to the VMM from the VM need about two thousand cycles. Therefore, in the direct execution, when the trap of the instruction and the change of the privileged mode occur frequently, the overhead is increased and a performance of the processor is deteriorated.
As one solution to the problem of the performance deterioration caused by the trapping and the mode change, a method with which the sensitive instruction of a guest operating system is rewritten as an instruction with which the trap is not generated can be used. There are two rewrite methods, one is a method with which the rewrite is performed statically and another is a method with which the rewrite is performed dynamically at the time of execution. However, when the method with which the instruction is rewritten statically is used, it is necessary to correct a source code or a binary code in advance. On the other hand, when the method with which the instruction is rewritten dynamically is used, a new additional process is required with the execution of the rewrite and a problem occurs in which the performance is degraded.
As another solution to the problem of the performance deterioration caused by the trapping and the mode change, Japanese Patent Application Laid-Open No. 2005-122711 discloses a technology with which a privileged instruction (instruction that needs a privileged mode) issued by the guest is trapped by the VMM, the synthetic instruction is generated sequentially to suppress an occurrence of a privilege violation, the change to the privileged mode is executed with the synthetic instruction and accordingly, a bad influence to virtualization is suppressed.
Japanese Patent Application Laid-Open No. 2007-35045 discloses a technology with which a processor device defines a virtual machine control structure (VMCS) for an execution environment of the VM and executes a change between the VM and the VMM according to the information on the VMCS.
However, in the technologies disclosed by Japanese Patent Application Laid-Open No. 2005-122711 and Japanese Patent Application Laid-Open No. 2007-35045, when the sensitive instruction that depends on a state of a system resource or an operation mode is executed during the execution of the VM, a control is transferred to the VMM from the VM ultimately. Namely, by using the technologies disclosed by the above-mentioned official bulletins, a number of times at which the control is transferred to the VMM from the VM can not be reduced. Therefore, a processing efficiency of a processor cannot be improved.